package com.yuntai.pms.model.constants;


import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class Constants {

    /**
     * 开发平台CLIENT_ID;-- 440000@310000
     */
    public final static String    CLIENT_ID                       = "100000@gateway";

    /**
     * TIMESTAMP时间约定格式
     */
    public final static String    TIMESTAMP                       = "yyyy-MM-dd HH:mm:ss";

    /**
     * TIMALAG最大时间差值
     */
    public final static long      MAX_TIMALAG                     = 60L;

    /**
     * CLIENT_SECRET缓存MAP
     */
    public static Map<String, Map> CLIENT_SECRET_MAP               = new ConcurrentHashMap();

    /**
     * CLIENT_SECRET缓存
     */
    public static String           CLIENT_SECRET                   = "client_secret";


	/**
	 * 连接超时时间(单位ms)
	 */
	public static Integer DEFAULT_CONN_TIME_OUT = 5;
	public static Integer CONN_TIME_OUT_MAX = 60;
	public static Integer CONN_TIME_OUT_MIN = 1;
	public static Integer[] CONN_TIME_OUT_RANGE ={CONN_TIME_OUT_MIN,CONN_TIME_OUT_MAX};

	/**
	 * 读取超时时间(单位ms)
	 */
	public static Integer DEFAULT_READ_TIME_OUT = 5;
	public static Integer READ_TIME_OUT_MAX = 60;
	public static Integer READ_TIME_OUT_MIN = 1;
	public static Integer[] READ_TIME_OUT_RANGE= {READ_TIME_OUT_MIN,READ_TIME_OUT_MAX};

	/**
	 * group的名称
	 */
	public static String UNIQUE_NAME_DEFAULT = "group";
	public static String[] UNIQUE_NAME_STANDARDS={UNIQUE_NAME_DEFAULT};
	/**
	 * 容量
	 */
	public static Integer DEFAULT_CAPABILITY = 10;
	public static Integer CAPABILITY_MIN = 1;
	public static Integer CAPABILITY_MAX = 100;
	public static Integer[] CAPABILITY_RANGE ={CAPABILITY_MIN,CAPABILITY_MAX};

	/**
	 * 优先级
	 */
	public static Integer PRIORITY_MIN = 1;
	public static Integer PRIORITY_MAX = 10;
	public static Integer DEFAULT_PRIORITY = 5;
	public static Integer[] PRIORITY_RANGE ={PRIORITY_MIN,PRIORITY_MAX};

	/**
	 * 状态
	 */
	public static String STATUS_ENABLE="enabled";//有效
	public static String STATUS_DISABLE="disabled";//无效
	public static String STATUS_CHECK ="check";//待审核
	public static String STATUS_DEFAULT=STATUS_CHECK;
	public static String[] STATUS_STANDARDS={STATUS_ENABLE,STATUS_DISABLE,STATUS_CHECK};

	/**
	 * IS_DELETED
	 */
	public static String IS_DELETED_N = "N";
	public static String IS_DELETED_Y = "Y";
	public static String IS_DELETED_L = "L";
	public static String IS_DELETED_DEFAULT = IS_DELETED_N;
	public static String[] IS_DELETED_STANDARDS = {IS_DELETED_N,IS_DELETED_Y,IS_DELETED_L};

	/**
	 * IS_VALID
	 */
	public static String IS_VALID_N = "N";
	public static String IS_VALID_Y = "Y";
	public static String IS_VALID_L = "L";
	public static String IS_VALID_DEFAULT = IS_VALID_N;
	public static String[] IS_VALID_STANDARDS = {IS_VALID_N,IS_VALID_Y,IS_VALID_L};

	/**
	 * 描述的最大和最短长度DESC
	 */
	public static Integer DESC_MIN_LENGTH = 10;
	public static Integer DESC_MAX_LENGTH = 128;
	public static Integer[] DESC_LENGTH_RANGE ={DESC_MIN_LENGTH,DESC_MAX_LENGTH};

	/**
	 * 默认版本
	 */
	public static String DEFAULT_VERSION = "1.1.0";

	/**
	 * 服务类型
	 */
	public static String INVOKE_SERVICE_TYPE_METHOD = "method";
	public static String INVOKE_SERVICE_TYPE_INTERFACE = "interface";
	public static String[] INVOKE_SERVICE_TYPE_STANDVALUES ={INVOKE_SERVICE_TYPE_METHOD,INVOKE_SERVICE_TYPE_INTERFACE};

	/**
	 * method的最大基本长度
	 */
	public static Integer METHOD_LENGTH_MAX = 128;
	public static Integer METHOD_LENGTH_MIN = 10;
	public static Integer[] METHOD_LENGTH_RANGE={METHOD_LENGTH_MIN,METHOD_LENGTH_MAX};

	/**
	 * 前缀
	 */
	public static String METHOD_FIRST_PREFIX ="yuntai";

	/**
	 * GROUP长度
	 */
	public static Integer METHOD_GROUP_MAX_LENGTH = 64;
	public static Integer METHOD_GROUP_MIN_LENGTH = 4;
	public static Integer[] METHOD_GROUP_LENGTH_RANGE = {METHOD_GROUP_MIN_LENGTH,METHOD_GROUP_MAX_LENGTH};

	/**
	 * Method最大可分段段数(包括yuntai.{group}.**.method)
	 */
	public static Integer METHOD_TRUNK_NUM_MAX = 9;

	/**
	 * 分段长度
	 */
	public static Integer METHOD_TRUNK_MAX_LENGTH = 32;
	public static Integer METHOD_TRUNK_MIN_LENGTH = 3;
	public static Integer[] METHOD_TRUNK_LENGTH_RANGE={METHOD_TRUNK_MIN_LENGTH,METHOD_TRUNK_MAX_LENGTH};

	/**
	 * SERVER_NAME
	 */
	public static Integer SERVER_NAME_MAX_LENGTH =32;
	public static Integer SERVER_NAME_MIN_LENGTH =4;
	public static Integer[] SERVER_NAME_LENGTH_RANGE = { SERVER_NAME_MIN_LENGTH, SERVER_NAME_MAX_LENGTH };


	public static Integer DEAFULAT_DUBBO_CONN_TIMEOUT= 30000;

	/** 扫描上传类路径的最大长度 */
	public static Integer CLASS_PATH_MAX_LENGTH = 128;
	/** 扫描上传类路径的最短长度 */
	public static Integer CLASS_PATH_MIN_LEGNTH = 1;
	public static Integer[] CLASS_PATH_LENGTH_RANGE ={CLASS_PATH_MIN_LEGNTH,CLASS_PATH_MAX_LENGTH};

	/** 服务检测功能配置,每半小时调用一次 */
	public static String HEART_BEAT_INTERVAL = "0 */30 * * * ?";


	public static Integer SERVER_DESC_MIN_LENGTH = 10;
	public static Integer SERVER_DESC_MAX_LENGTH = 128;

	public static Integer[] SERVER_DESC_LENGTH_RANGE = {SERVER_DESC_MIN_LENGTH,SERVER_DESC_MAX_LENGTH};


	public static String SPLIT_CHAR_COMMA = ",";//逗号
	public static String SPLIT_CHAR_COLON = ":";//冒号
}

